home *** CD-ROM | disk | FTP | other *** search
/ PD ROM 1 / PD ROM Volume I - Macintosh Software from BMUG (1988).iso / Stacks / Hyper Education / Organizational Aids / Student Teacher / background_2772.txt < prev    next >
Encoding:
Text File  |  1988-04-09  |  13.6 KB  |  610 lines

  1. -- background: 2772 from stack: in
  2. -- bmap block id: 3308
  3. -- flags: 4000
  4. -- background id: 0
  5. -- name: Class Bkgnd
  6. ----- HyperTalk script -----
  7. on mouseup
  8.   Put the id of the target into theid
  9.   if the name of the target contains "bkgnd field" then
  10.  
  11.     if the short name of the target is not "Class Name" and the short name of the target is not "Class Number" then
  12.       if field id theid is not empty then
  13.         Put line 1 of field id theid into PickedName
  14.         if the shiftkey is down then
  15.           answer "Delete "&PickedName&" from this class?" with "Yes" or "Cancel"
  16.           if it is "Yes" then
  17.             Put "" into field id Theid
  18.           else
  19.             Exit to hypercard
  20.           end if
  21.         end if
  22.  
  23.         go to card PickedName of bkgnd "Student bkgnd"
  24.       end if
  25.     end if
  26.   end if
  27. end mouseup
  28.  
  29.  
  30. on controlkey whichkey
  31.  
  32.   if whichkey is 19 then
  33.     send mouseup to bkgnd button "Add Student"
  34.   else if whichkey is 20 then
  35.     send mouseup to bkgnd button "Add Test"
  36.   else
  37.     Pass controlkey
  38.   end if
  39. end controlkey
  40.  
  41. on GetGrades
  42.   Put card field "11PupF" of first card into Levels
  43.   Repeat with x=3 to number of fields
  44.     if field x is not empty then
  45.       Put word 1 of line 3 of field x into theaverage
  46.       repeat with y=1 to number of lines in levels
  47.         if theaverage<item 2 of line y of levels and theaverage>= item 3 of line y of levels then
  48.           Put item 1 of line y of levels into HisGrade
  49.           Put HisGrade into word 1 of line 4 of field x
  50.         end if
  51.       end repeat
  52.     end if
  53.   end repeat
  54. end getgrades
  55.  
  56.  
  57.  
  58.  
  59. on GetAverages
  60.   Set NumberFormat to xx.0
  61.   Repeat with x=3 to number of fields
  62.     if field x is not empty then
  63.       Put 0 into PrevEntry
  64.       Put 0 into TestMissed
  65.       Put 0 into z
  66.       Put line 1 of field x into ThisName
  67.       Put field "Grades" of card ThisName of bkgnd "Student bkgnd" into StuGrades
  68.       Put field "Weights" of card ThisName of bkgnd "Student bkgnd" into StuWeights
  69.       if stuweights is empty or stugrades is empty then exit if
  70.       repeat with y=1 to number of items in StuWeights
  71.         Put item y of StuGrades into grade
  72.         Put item y of StuWeights into weight
  73.         if y is the number of items in StuWeights then
  74.           delete last char of grade
  75.           delete last char of weight
  76.         end if
  77.         if grade is "*" then
  78.           Put TestMissed+1 into TestMissed
  79.         else
  80.           Put grade*weight into ThisEntry
  81.           Put ThisEntry+PrevEntry into PrevEntry
  82.           Put z+weight into z
  83.         end if
  84.       end repeat
  85.       Put PrevEntry/z into TheAverage
  86.       Put TheAverage into word 1 of line 3 of field x
  87.       Put TestMissed into word 1 of line 2 of field x
  88.     end if
  89.   end repeat
  90.   GetGrades
  91. end getaverages
  92.  
  93.  
  94.  
  95.  
  96. on HereAreGrades
  97.   Global ThePass,TheWeight
  98.   Repeat with x= 1 to number of lines in ThePass
  99.     Put item 1 of line x of thepass into TheName
  100.     Put item 2 of line x of thepass into TheGrade
  101.     Put TheGrade&"," after field "Grades" of card TheName of bkgnd "Student Bkgnd"
  102.     Put TheWeight&"," after field "Weights" of card TheName of bkgnd "Student Bkgnd"
  103.   end repeat
  104.   GetAverages
  105. end HereAreGrades
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115. -- part 20 (field)
  116. -- low flags: 01
  117. -- high flags: 0000
  118. -- rect: left=107 top=62 right=79 bottom=293
  119. -- title width / last selected line: 0
  120. -- icon id / first selected line: 0 / 0
  121. -- text alignment: 0
  122. -- font id: 2
  123. -- text size: 12
  124. -- style flags: 256
  125. -- line height: 16
  126. -- part name: Class Name
  127.  
  128.  
  129. -- part 21 (field)
  130. -- low flags: 01
  131. -- high flags: 0000
  132. -- rect: left=419 top=41 right=58 bottom=480
  133. -- title width / last selected line: 0
  134. -- icon id / first selected line: 0 / 0
  135. -- text alignment: 1
  136. -- font id: 223
  137. -- text size: 12
  138. -- style flags: 256
  139. -- line height: 16
  140. -- part name: Class Number
  141.  
  142.  
  143. -- part 46 (field)
  144. -- low flags: 01
  145. -- high flags: 0002
  146. -- rect: left=5 top=145 right=192 bottom=105
  147. -- title width / last selected line: 0
  148. -- icon id / first selected line: 0 / 0
  149. -- text alignment: 0
  150. -- font id: 20
  151. -- text size: 10
  152. -- style flags: 0
  153. -- line height: 11
  154. -- part name: 
  155.  
  156.  
  157. -- part 47 (field)
  158. -- low flags: 01
  159. -- high flags: 0002
  160. -- rect: left=106 top=145 right=192 bottom=206
  161. -- title width / last selected line: 0
  162. -- icon id / first selected line: 0 / 0
  163. -- text alignment: 0
  164. -- font id: 20
  165. -- text size: 10
  166. -- style flags: 0
  167. -- line height: 11
  168. -- part name: 
  169.  
  170.  
  171. -- part 48 (field)
  172. -- low flags: 01
  173. -- high flags: 0002
  174. -- rect: left=207 top=145 right=192 bottom=307
  175. -- title width / last selected line: 0
  176. -- icon id / first selected line: 0 / 0
  177. -- text alignment: 0
  178. -- font id: 20
  179. -- text size: 10
  180. -- style flags: 0
  181. -- line height: 11
  182. -- part name: 
  183.  
  184.  
  185. -- part 49 (field)
  186. -- low flags: 01
  187. -- high flags: 0002
  188. -- rect: left=308 top=145 right=192 bottom=408
  189. -- title width / last selected line: 0
  190. -- icon id / first selected line: 0 / 0
  191. -- text alignment: 0
  192. -- font id: 20
  193. -- text size: 10
  194. -- style flags: 0
  195. -- line height: 11
  196. -- part name: 
  197.  
  198.  
  199. -- part 50 (field)
  200. -- low flags: 01
  201. -- high flags: 0002
  202. -- rect: left=409 top=145 right=192 bottom=509
  203. -- title width / last selected line: 0
  204. -- icon id / first selected line: 0 / 0
  205. -- text alignment: 0
  206. -- font id: 20
  207. -- text size: 10
  208. -- style flags: 0
  209. -- line height: 11
  210. -- part name: 
  211.  
  212.  
  213. -- part 51 (field)
  214. -- low flags: 01
  215. -- high flags: 0002
  216. -- rect: left=5 top=194 right=241 bottom=105
  217. -- title width / last selected line: 0
  218. -- icon id / first selected line: 0 / 0
  219. -- text alignment: 0
  220. -- font id: 20
  221. -- text size: 10
  222. -- style flags: 0
  223. -- line height: 11
  224. -- part name: 
  225.  
  226.  
  227. -- part 52 (field)
  228. -- low flags: 01
  229. -- high flags: 0002
  230. -- rect: left=106 top=194 right=241 bottom=206
  231. -- title width / last selected line: 0
  232. -- icon id / first selected line: 0 / 0
  233. -- text alignment: 0
  234. -- font id: 20
  235. -- text size: 10
  236. -- style flags: 0
  237. -- line height: 11
  238. -- part name: 
  239.  
  240.  
  241. -- part 53 (field)
  242. -- low flags: 01
  243. -- high flags: 0002
  244. -- rect: left=207 top=194 right=241 bottom=307
  245. -- title width / last selected line: 0
  246. -- icon id / first selected line: 0 / 0
  247. -- text alignment: 0
  248. -- font id: 20
  249. -- text size: 10
  250. -- style flags: 0
  251. -- line height: 11
  252. -- part name: 
  253.  
  254.  
  255. -- part 54 (field)
  256. -- low flags: 01
  257. -- high flags: 0002
  258. -- rect: left=308 top=194 right=241 bottom=408
  259. -- title width / last selected line: 0
  260. -- icon id / first selected line: 0 / 0
  261. -- text alignment: 0
  262. -- font id: 20
  263. -- text size: 10
  264. -- style flags: 0
  265. -- line height: 11
  266. -- part name: 
  267.  
  268.  
  269. -- part 55 (field)
  270. -- low flags: 01
  271. -- high flags: 0002
  272. -- rect: left=409 top=194 right=241 bottom=509
  273. -- title width / last selected line: 0
  274. -- icon id / first selected line: 0 / 0
  275. -- text alignment: 0
  276. -- font id: 20
  277. -- text size: 10
  278. -- style flags: 0
  279. -- line height: 11
  280. -- part name: 
  281.  
  282.  
  283. -- part 56 (field)
  284. -- low flags: 01
  285. -- high flags: 0002
  286. -- rect: left=5 top=243 right=290 bottom=105
  287. -- title width / last selected line: 0
  288. -- icon id / first selected line: 0 / 0
  289. -- text alignment: 0
  290. -- font id: 20
  291. -- text size: 10
  292. -- style flags: 0
  293. -- line height: 11
  294. -- part name: 
  295.  
  296.  
  297. -- part 57 (field)
  298. -- low flags: 01
  299. -- high flags: 0002
  300. -- rect: left=106 top=243 right=290 bottom=206
  301. -- title width / last selected line: 0
  302. -- icon id / first selected line: 0 / 0
  303. -- text alignment: 0
  304. -- font id: 20
  305. -- text size: 10
  306. -- style flags: 0
  307. -- line height: 11
  308. -- part name: 
  309.  
  310.  
  311. -- part 58 (field)
  312. -- low flags: 01
  313. -- high flags: 0002
  314. -- rect: left=207 top=243 right=290 bottom=307
  315. -- title width / last selected line: 0
  316. -- icon id / first selected line: 0 / 0
  317. -- text alignment: 0
  318. -- font id: 20
  319. -- text size: 10
  320. -- style flags: 0
  321. -- line height: 11
  322. -- part name: 
  323.  
  324.  
  325. -- part 59 (field)
  326. -- low flags: 01
  327. -- high flags: 0002
  328. -- rect: left=308 top=243 right=290 bottom=408
  329. -- title width / last selected line: 0
  330. -- icon id / first selected line: 0 / 0
  331. -- text alignment: 0
  332. -- font id: 20
  333. -- text size: 10
  334. -- style flags: 0
  335. -- line height: 11
  336. -- part name: 
  337.  
  338.  
  339. -- part 60 (field)
  340. -- low flags: 01
  341. -- high flags: 0002
  342. -- rect: left=409 top=243 right=290 bottom=509
  343. -- title width / last selected line: 0
  344. -- icon id / first selected line: 0 / 0
  345. -- text alignment: 0
  346. -- font id: 20
  347. -- text size: 10
  348. -- style flags: 0
  349. -- line height: 11
  350. -- part name: 
  351.  
  352.  
  353. -- part 61 (field)
  354. -- low flags: 01
  355. -- high flags: 0002
  356. -- rect: left=5 top=292 right=339 bottom=105
  357. -- title width / last selected line: 0
  358. -- icon id / first selected line: 0 / 0
  359. -- text alignment: 0
  360. -- font id: 20
  361. -- text size: 10
  362. -- style flags: 0
  363. -- line height: 11
  364. -- part name: 
  365.  
  366.  
  367. -- part 62 (field)
  368. -- low flags: 01
  369. -- high flags: 0002
  370. -- rect: left=106 top=292 right=339 bottom=206
  371. -- title width / last selected line: 0
  372. -- icon id / first selected line: 0 / 0
  373. -- text alignment: 0
  374. -- font id: 20
  375. -- text size: 10
  376. -- style flags: 0
  377. -- line height: 11
  378. -- part name: 
  379.  
  380.  
  381. -- part 63 (field)
  382. -- low flags: 01
  383. -- high flags: 0002
  384. -- rect: left=207 top=292 right=339 bottom=307
  385. -- title width / last selected line: 0
  386. -- icon id / first selected line: 0 / 0
  387. -- text alignment: 0
  388. -- font id: 20
  389. -- text size: 10
  390. -- style flags: 0
  391. -- line height: 11
  392. -- part name: 
  393.  
  394.  
  395. -- part 64 (field)
  396. -- low flags: 01
  397. -- high flags: 0002
  398. -- rect: left=308 top=292 right=339 bottom=408
  399. -- title width / last selected line: 0
  400. -- icon id / first selected line: 0 / 0
  401. -- text alignment: 0
  402. -- font id: 20
  403. -- text size: 10
  404. -- style flags: 0
  405. -- line height: 11
  406. -- part name: 
  407.  
  408.  
  409. -- part 65 (field)
  410. -- low flags: 01
  411. -- high flags: 0002
  412. -- rect: left=409 top=292 right=339 bottom=509
  413. -- title width / last selected line: 0
  414. -- icon id / first selected line: 0 / 0
  415. -- text alignment: 0
  416. -- font id: 20
  417. -- text size: 10
  418. -- style flags: 0
  419. -- line height: 11
  420. -- part name: 
  421.  
  422.  
  423. -- part 66 (button)
  424. -- low flags: 00
  425. -- high flags: A003
  426. -- rect: left=10 top=103 right=119 bottom=101
  427. -- title width / last selected line: 0
  428. -- icon id / first selected line: 0 / 0
  429. -- text alignment: 1
  430. -- font id: 0
  431. -- text size: 12
  432. -- style flags: 0
  433. -- line height: 16
  434. -- part name: Add Student
  435. ----- HyperTalk script -----
  436. on mouseUp
  437.   set cursor to 4
  438.   Set lockscreen to true
  439.   Push Card
  440.   Ask "What is this students name"
  441.   Put it into NewName
  442.   if it is "" then exit to hypercard
  443.   repeat with x=3 to the number of fields
  444.     if field x is empty then
  445.       Put NewName into line 1 of field x
  446.       Put "  0   Missed Tests" into line 2 of field x
  447.       Put "  0   Average" into line 3 of field x
  448.       Put "  0   Grade" into line 4 of field x
  449.       Put field "Class Name" into CName
  450.       Go to bkgnd "Student Bkgnd"
  451.       Type "N" with commandkey
  452.       Put CName into field "Class Name"
  453.       Set the name of this card to NewName
  454.       Put NewName into field "Student Name"
  455.  
  456.       pop card
  457.       Put field "Class Number"+1 into field "Class Number"
  458.       Exit to Hypercard
  459.     end if
  460.   end repeat
  461.   beep (1)
  462.   answer "The Class is Full"
  463. end mouseUp
  464.  
  465.  
  466.  
  467. -- part 67 (button)
  468. -- low flags: 00
  469. -- high flags: A003
  470. -- rect: left=9 top=123 right=139 bottom=101
  471. -- title width / last selected line: 0
  472. -- icon id / first selected line: 0 / 0
  473. -- text alignment: 1
  474. -- font id: 0
  475. -- text size: 12
  476. -- style flags: 0
  477. -- line height: 16
  478. -- part name: Add Test
  479. ----- HyperTalk script -----
  480. on mouseUp
  481.   Set Cursor to 4
  482.   repeat with x=3 to the number of fields
  483.     Put line 1 of field x into thename
  484.     if thename is not empty then
  485.       Put thename&return after TheNames
  486.     end if
  487.   end repeat
  488.   if thenames is empty then exit to hypercard
  489.   Put field "Class Name" into CName
  490.   Push Card
  491.   ask "Name this test"
  492.   if it is "" then exit to hypercard
  493.   go to bkgnd "Tests"
  494.  
  495.   Type "N" with commandkey
  496.   Put it into field "Test Name"
  497.   Put CName into field "Class Name"
  498.   Put TheNames into field "Scores"
  499.   EnterTest
  500. end mouseUp
  501.  
  502.  
  503.  
  504. -- part 68 (button)
  505. -- low flags: 00
  506. -- high flags: 2000
  507. -- rect: left=470 top=107 right=130 bottom=498
  508. -- title width / last selected line: 0
  509. -- icon id / first selected line: 21700 / 21700
  510. -- text alignment: 1
  511. -- font id: 0
  512. -- text size: 12
  513. -- style flags: 0
  514. -- line height: 16
  515. -- part name: Home
  516. ----- HyperTalk script -----
  517. on mouseUp
  518.   visual effect dissolve slowly to black
  519.   visual effect iris open slow to white
  520.   visual effect dissolve
  521.   go to home
  522. end mouseUp
  523.  
  524.  
  525.  
  526. -- part 69 (button)
  527. -- low flags: 00
  528. -- high flags: A003
  529. -- rect: left=110 top=103 right=119 bottom=202
  530. -- title width / last selected line: 0
  531. -- icon id / first selected line: 0 / 0
  532. -- text alignment: 1
  533. -- font id: 0
  534. -- text size: 12
  535. -- style flags: 0
  536. -- line height: 16
  537. -- part name: Add Class
  538. ----- HyperTalk script -----
  539. on mouseUp
  540.   Set Cursor to 4
  541.   Set lockscreen to true
  542.   ask "Name this Class"
  543.   if it is "" then exit to hypercard
  544.   Type "N" with commandkey
  545.   Put it into field "Class Name"
  546.   Put 0 into field "Class Number"
  547. end mouseUp
  548.  
  549.  
  550.  
  551. -- part 71 (button)
  552. -- low flags: 00
  553. -- high flags: 2000
  554. -- rect: left=231 top=109 right=132 bottom=261
  555. -- title width / last selected line: 0
  556. -- icon id / first selected line: 9301 / 9301
  557. -- text alignment: 1
  558. -- font id: 0
  559. -- text size: 12
  560. -- style flags: 0
  561. -- line height: 16
  562. -- part name: New Button
  563. ----- HyperTalk script -----
  564. on mouseUp
  565.   visual effect venetian blinds
  566.   go to previous card of this bkgnd
  567. end mouseUp
  568.  
  569.  
  570.  
  571. -- part 72 (button)
  572. -- low flags: 00
  573. -- high flags: A003
  574. -- rect: left=399 top=112 right=127 bottom=458
  575. -- title width / last selected line: 0
  576. -- icon id / first selected line: 0 / 0
  577. -- text alignment: 1
  578. -- font id: 0
  579. -- text size: 12
  580. -- style flags: 0
  581. -- line height: 16
  582. -- part name: Tests
  583. ----- HyperTalk script -----
  584. on mouseUp
  585.   Put field "Class Name" into holder
  586.   go to bkgnd "Tests"
  587.   find holder in field "Class Name"
  588. end mouseUp
  589.  
  590.  
  591.  
  592. -- part 70 (button)
  593. -- low flags: 00
  594. -- high flags: 2000
  595. -- rect: left=263 top=109 right=132 bottom=293
  596. -- title width / last selected line: 0
  597. -- icon id / first selected line: 27009 / 27009
  598. -- text alignment: 1
  599. -- font id: 0
  600. -- text size: 12
  601. -- style flags: 0
  602. -- line height: 16
  603. -- part name: New Button
  604. ----- HyperTalk script -----
  605. on mouseUp
  606.   visual effect venetian blinds
  607.   go to next card of this bkgnd
  608. end mouseUp
  609.  
  610.